﻿using Ewelve_Mouth_HD.DAL;
using Ewelve_Mouth_HD.Model;

namespace Ewelve_Mouth_HD.BLL
{
    public class TypeBll
    {
        private readonly TypeDal typeDal;

        public TypeBll(TypeDal _typeDal)
        {
            typeDal = _typeDal;
        }
        /// <summary>
        /// 房型添加
        /// </summary>
        /// <param name="E"></param>
        /// <returns></returns>
        public int RoomTypeAdd(RoomType E)
        {
            try
            {
                return typeDal.RoomTypeAdd(E);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 房型分页，查询显示
        /// </summary>
        /// <param name="RoomName"></param>
        /// <param name="MaxArea"></param>
        /// <param name="MinArea"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageSum"></param>
        /// <param name="PageCount"></param>
        /// <returns></returns>
        public IQueryable TypeShowAll(string? RoomName, int MaxArea, int MinArea, int PageIndex, int PageSize, out int PageSum, out int PageCount)
        {
            return typeDal.TypeShowAll(RoomName, MaxArea, MinArea, PageIndex, PageSize, out PageSum, out PageCount);
        }
        /// <summary>
        /// 绑定下拉框
        /// </summary>
        /// <returns></returns>
        public IQueryable SelectShow()
        {
            return typeDal.SelectShow();
        }
    }
}
